/*
 * @Author: doing
 * @Date: 2023-08-22 21:06:25
 * @LastEditors: git config user.name && git config user.email
 * @LastEditTime: 2023-08-23 20:21:48
 * @FilePath: \center\src\router\index.js
 * @Description: 
 * 配置路由选项
 * Copyright (c) 2023 by 1540265624@qq.com, All Rights Reserved. 
 */

import {
    createRouter,
    createWebHashHistory
} from 'vue-router'

//基本路由组件
import Login from '~/pages/Login.vue'
import Refresh from '~/pages/Refresh.vue'


//默认路由,由所有用户共享
const routes = [
    {
        path: '/login',
        component: Login,
        meta: {
            title: '登录页'
        }
    },
    {
        path: '/refresh',
        component: Refresh,
        meta: {
            title: '令牌刷新'
        }
    },
    {
        path: '/:pathMatch(.*)*',
        name: 'NotFound',
        redirect: '/login'
    }
]


//动态将组件添加到路由中去(注意菜单显示是在FMenu组件中调用了$store.state.menu然后才显示出菜单左侧)
export const router = createRouter({
    history: createWebHashHistory(),
    routes
})
